import request from '@/utils/request'

export function listGood(data) {
  return request({
    url: '/ims/productSku/page', method: 'get', params: data
  })
}



/**商品类别*/
export function listGoodType(data) {
  return request({
    url: '/ims/product/category/tree', method: 'get', params: data
  })
}
export function listGoodTypeSelect(data) {
  return request({
    url: '/ims/product/category/list', method: 'get', params: data
  })
}
export function addGoodType(data) {
  return request({
    url: '/ims/product/category', method: 'post', data: data
  })
}

export function updateGoodType(data) {
  return request({
    url: '/ims/product/category', method: 'put', data: data
  })
}

export function deleteGoodType(data) {
  return request({
    url: '/ims/product/category/' + data, method: 'delete'
  })
}

/**库存管理*/

export function listStoreStock(data) {
  return request({
    url: '/ims/inventory/boardList/warehouse', method: 'get', params: data
  })
}

export function listGoodStock(data) {
  return request({
    url: '/ims/inventory/boardList/product', method: 'get', params: data
  })
}

/**库存记录*/
export function listStoreLog(data) {
  return request({
    url: '/ims/inventoryHistory/page', method: 'get', params: data
  })
}

/**仓库管理*/
export function listStore(data) {
  return request({
    url: '/ims/warehouse/page', method: 'get', params: data
  })
}

export function addStore(data) {
  return request({
    url: '/ims/warehouse', method: 'post', data: data
  })
}

export function updateStore(data) {
  return request({
    url: '/ims/warehouse', method: 'put', data: data
  })
}

export function deleteStore(data) {
  return request({
    url: '/ims/warehouse/' + data, method: 'delete'
  })
}

/**品牌管理*/
export function listBrand(data) {
  return request({
    url: '/ims/productBrand/page', method: 'get', params: data
  })
}

export function addBrand(data) {
  return request({
    url: '/ims/productBrand', method: 'post', data: data
  })
}

export function updateBrand(data) {
  return request({
    url: '/ims/productBrand', method: 'put', data: data
  })
}

export function deleteBrand(data) {
  return request({
    url: '/ims/productBrand/' + data, method: 'delete'
  })
}

/**单位管理*/
export function listUnit(data) {
  return request({
    url: '/ims/merchant/page', method: 'get', params: data
  })
}

export function addUnit(data) {
  return request({
    url: '/ims/merchant', method: 'post', data: data
  })
}

export function updateUnit(data) {
  return request({
    url: '/ims/merchant', method: 'put', data: data
  })
}

export function deleteUnit(data) {
  return request({
    url: '/ims/merchant/' + data, method: 'delete'
  })
}

/**入库管理*/
export function listInStore(data) {
  return request({
    url: '/ims/receiptOrder/page', method: 'get', params: data
  })
}

export function addInStore(data) {
  return request({
    url: '/ims/receiptOrder', method: 'post', data: data
  })
}

export function updateInStore(data) {
  return request({
    url: '/ims/receiptOrder', method: 'put', data: data
  })
}

export function deleteInStore(data) {
  return request({
    url: '/ims/receiptOrder/' + data, method: 'delete'
  })
}

/**出库管理*/
export function listOutStore(data) {
  return request({
    url: '/ims/shipmentOrder/page', method: 'get', params: data
  })
}

export function addOutStore(data) {
  return request({
    url: '/ims/shipmentOrder', method: 'post', data: data
  })
}
export function changeOutStore(data) {
  return request({
    url: '/ims/shipmentOrder/shipped', method: 'post', data: data
  })
}
export function changeOutStore2(data) {
  return request({
    url: '/ims/shipmentOrder/express/shipment', method: 'post', data: data
  })
}
export function updateOutStore(data) {
  return request({
    url: '/ims/shipmentOrder', method: 'put', data: data
  })
}

export function deleteOutStore(data) {
  return request({
    url: '/ims/shipmentOrder/' + data, method: 'delete'
  })
}
/**移库管理*/
export function listMoveStore(data) {
  return request({
    url: '/ims/movementOrder/page', method: 'get', params: data
  })
}

export function addMoveStore(data) {
  return request({
    url: '/ims/movementOrder', method: 'post', data: data
  })
}

export function updateMoveStore(data) {
  return request({
    url: '/ims/movementOrder', method: 'put', data: data
  })
}

export function deleteMoveStore(data) {
  return request({
    url: '/ims/movementOrder/' + data, method: 'delete'
  })
}
/**盘库管理*/
export function listCheckStore(data) {
  return request({
    url: '/ims/checkOrder/page', method: 'get', params: data
  })
}

export function addCheckStore(data) {
  return request({
    url: '/ims/checkOrder', method: 'post', data: data
  })
}

export function updateCheckStore(data) {
  return request({
    url: '/ims/checkOrder', method: 'put', data: data
  })
}

export function deleteCheckStore(data) {
  return request({
    url: '/ims/checkOrder/' + data, method: 'delete'
  })
}
/** 商品属性*/
export function listGoodAttr(data) {
  return request({
    url: '/ims/sku/attribute/list', method: 'get',params:data
  })
}

export function addGoodAttr(data) {
  return request({
    url: '/ims/sku/attribute', method: 'post',data:data
  })
}
export function updateGoodAttr(data) {
  return request({
    url: '/ims/sku/attribute', method: 'put',data:data
  })
}
export function deleteGoodAttr(data) {
  return request({
    url: '/ims/sku/attribute/'+data, method: 'delete'
  })
}
export function listGoodAttrSelect(data) {
  return request({
    url: '/ims/sku/attribute/page', method: 'get',params:data
  })
}
/** 商品规格*/

export function listGoodSku(data) {
  return request({
    url: '/ims/productSku/page', method: 'get',params:data
  })
}
export function listGoodSkuAttr(data) {
  return request({
    url: '/ims/sku/attribute/page', method: 'get',params:data
  })
}
export function getGoodSku(data) {
  return request({
    url: '/ims/productSku/customer/sku/'+data, method: 'get',params:data
  })
}
export function addGoodSku(data) {
  return request({
    url: '/ims/productSku', method: 'post',data:data
  })
}
export function updateGoodSku(data) {
  return request({
    url: '/ims/productSku', method: 'put',data:data
  })
}
export function deleteGoodSku(data) {
  return request({
    url: '/ims/productSku/'+data, method: 'delete'
  })
}
export function listGoodPart(data) {
  return request({
    url: '/ims/sale/bom/partsku', method: 'get',params:data
  })
}
export function listGoodSkuById(data) {
  return request({
    url: '/ims/sale/bom/salesku', method: 'get',params:data
  })
}
